package com.aliyun.messagemgt.common.base;

import java.util.List;
import java.util.Objects;

/**
 * Created with IDEA
 * 前端页面实体
 * @author:zhangxingxing 0027012120
 * @date:2019/4/16
 * @time:9:06
 */
//@JsonInclude(JsonInclude.Include.NON_NULL)
public class FrontPageEntity implements Comparable<FrontPageEntity> {

    private String key;

    private String name;

//    @JsonIgnore
    private String type;

//    @JsonIgnore
    private String parent;

    private String icon;

    private String url;

    private List<FrontPageEntity> children;

    public String getName() {
        return name;
    }

    public FrontPageEntity setName(String name) {
        this.name = name;
        return this;
    }

    public String getIcon() {
        return icon;
    }

    public FrontPageEntity setIcon(String icon) {
        this.icon = icon;
        return this;
    }

    public String getUrl() {
        return url;
    }

    public FrontPageEntity setUrl(String url) {
        this.url = url;
        return this;
    }

    public List<FrontPageEntity> getChildren() {
        return children;
    }

    public FrontPageEntity setChildren(List<FrontPageEntity> children) {
        this.children = children;
        return this;
    }

    public String getKey() {
        return key;
    }

    public FrontPageEntity setKey(String key) {
        this.key = key;
        return this;
    }

    public String getParent() {
        return parent;
    }

    public FrontPageEntity setParent(String parent) {
        this.parent = parent;
        return this;
    }

    public String getType() {
        return type;
    }

    public FrontPageEntity setType(String type) {
        this.type = type;
        return this;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("FrontPageEntity{");
        sb.append("key='").append(key).append('\'');
        sb.append(", name='").append(name).append('\'');
        sb.append(", type='").append(type).append('\'');
        sb.append(", parent='").append(parent).append('\'');
        sb.append(", icon='").append(icon).append('\'');
        sb.append(", url='").append(url).append('\'');
        sb.append(", children=").append(children);
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        FrontPageEntity that = (FrontPageEntity) o;
        return Objects.equals(getKey(), that.getKey()) &&
                Objects.equals(getName(), that.getName()) &&
                Objects.equals(getType(), that.getType()) &&
                Objects.equals(getParent(), that.getParent()) &&
                Objects.equals(getIcon(), that.getIcon()) &&
                Objects.equals(getUrl(), that.getUrl()) &&
                Objects.equals(getChildren(), that.getChildren());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getKey(), getName(), getType(), getParent(), getIcon(), getUrl(), getChildren());
    }

    @Override
    public int compareTo(FrontPageEntity o) {
        return (this.key).compareTo(o.key);
    }
}
